package com.company.lagou.homework.homework3;

import java.net.ServerSocket;
import java.net.Socket;

public class MyServer {
    public static void main(String[] args) {
        try {
            ServerSocket ss = new ServerSocket(6666);
            System.out.println("服务器已启动，等待客户端连接...");
            while (true){
                Socket accept = ss.accept();
                System.out.println("已经有客户端上线!"+accept);
                new ServerThread(accept).start();
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
